**********************************************************************************	
*** TABLE A4: Intercept-shift and semi-parametric
********************************************************************************** 

* Intercept-shift: year-of-hearing, year2+.
use "$DATALOC/AgencyLevel.dta", replace
eststo app_a_i_1: reghdfe iprate agen_hear_all last_agen_2_plus ,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace

use "$DATALOC/ProgramLevel.dta", replace
eststo app_p_i_1: reghdfe iprate agen_hear_all last_agen_2_plus ,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace

use "$DATALOC/AgencyLevel.dta", replace
* Semi-parametric: lagged hearing effects
eststo app_a_sp_4: reghdfe iprate agen_hear_all agen_hear_all_lag1 agen_hear_all_lag2 agen_hear_all_lag3 agen_hear_all_lag4 ,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
use "$DATALOC/ProgramLevel.dta", replace
eststo app_p_sp_4: reghdfe iprate agen_hear_all agen_hear_all_lag1 agen_hear_all_lag2 agen_hear_all_lag3 agen_hear_all_lag4 ,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	

	
*** OUTPUT TABLE
esttab app_a_i_1 app_a_sp_4 app_p_i_1 app_p_sp_4 using "$TABLELOC/TableA04.tex", ///
	prehead("\begin{table}[htbp]\centering \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \caption{Dynamic Effect of Hearings on Improper Payment Rate, Intercept-Shift and Semi-Parametric Specifications. Dependent variable is improper payment rate as a percent of all payments.} \resizebox{\textwidth}{!}{ \begin{tabular}{l*{5}{c}} \toprule") ///
	b(a2) fragment ///
	booktabs label se star(** 0.05 *** 0.01)s(fixedyear fixedagency N, label("Fiscal Year FE" "Agency/Program FE" "Observations")) ///
	order(last_agen_2_plus agen_hear_all agen_hear_all_lag1 agen_hear_all_lag2 agen_hear_all_lag3 agen_hear_all_lag4) keep(agen* last*) ///
	nomtitles ///
	mgroups("Agency-level" "Program-level", ///
				pattern(1 0 1 0) ///
				span prefix(\multicolumn{@span}{c}{) suffix(})) ///
	prefoot("\hline") ///
	postfoot("\bottomrule \multicolumn{4}{l}{\footnotesize Standard errors in parentheses; clustered on agency-year for program-level analysis.}\\ \multicolumn{4}{l}{\footnotesize \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\ \end{tabular} } \\ \label{tab:otherspec} \end{table}") replace

